﻿<header class="header">
    <h2>Client Data Warehouse Synchronization</h2>
</header>

<section id="content" class="content" ng-controller="shell">

    <div class="msg-green">
        Machine name: <label ng-bind="machineName"></label><br />
        Last good database group: <label ng-bind="lastDatabaseGroup"></label><br />
        Updating database group: <label ng-bind="currentDatabaseGroup"></label><br />
        Automatic synchronization: <label ng-bind="isSyncAutomatic"></label><br />
        Skip cloning: <label ng-bind="skipCloning"></label><br />
        Next automatic start: <label ng-bind="nextAutoStart"></label><br />
        Error policy: <label ng-bind="errPolicy"></label><br />
        Service status: <label ng-bind="serviceStatus"></label><br />
        Last session status: <label ng-bind="lastSessionStatus"></label><br />
        Progress: <label ng-bind="syncProgress"></label><br />
    </div>

    <table>
        <tr>
            <td>
                <table class="table table-hover table-condensed">
                    <tr>
                        <th>#</th>
                        <th>Step</th>
                        <th>
                            <button ng-click="toggleAllSyncSteps(true)">All</button>
                            <button ng-click="toggleAllSyncSteps(false)">None</button>
                        </th>
                    </tr>

                    <tr ng-repeat="item in syncSteps" ng-class="{success:item.selected}" ng-disabled="isSynchronizing">
                        <td>{{item.ExecutionOrder+1}}</td>
                        <td><label><input type="checkbox" ng-model="item.Execute" ng-disabled="isSynchronizing">{{item.Name}}</label></td>
                        <td>
                            <button class="btn btn-xs" ng-click="moveUp($index)" ng-disabled="isSynchronizing"> <i class="glyphicon glyphicon-arrow-up"></i></button>
                            <button class="btn btn-xs" ng-click="moveDown($index)" ng-disabled="isSynchronizing"><i class="glyphicon glyphicon-arrow-down"></i></button>
                        </td>
                    </tr>
                </table>
            </td>
            <td style="height: 300px;">
                <ul style="overflow: auto; height: 100%; padding-top: 25px;" id="messages"></ul>
            </td>
        </tr>
    </table>

    <br />

    <div>
        <button class="btn-green" ng-disabled="isHubInactive() || isSynchronizing" ng-click="syncCmd()">     Sync     </button>
        <button class="btn-green" ng-disabled="isHubInactive() || !isSynchronizing" ng-click="cancelCmd()">     Cancel     </button>
    </div>
</section>
